import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

// 日志类
class LogEntry {
    private LocalDateTime timestamp;
    private String operationType;
    private String operator;
    public String details;

    public LogEntry(String operationType, String operator, String details) {
        this.timestamp = LocalDateTime.now();
        this.operationType = operationType;
        this.operator = operator;
        this.details = details;
    }

    // Getters
    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public String getOperationType() {
        return operationType;
    }

    public String getOperator() {
        return operator;
    }

    public String getDetails() {
        return details;
    }

    @Override
    public String toString() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return String.format("[%s] %s - 操作人: %s - %s",
                timestamp.format(formatter), operationType, operator, details);
    }
}
